/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrameUtama.java
 *
 * Created on Dec 3, 2010, 9:32:24 PM
 */

package stta.elinfo.perpustakaan.gui;

import javax.swing.JOptionPane;

/**
 *
 * @author fendi
 */
public class FrameUtama extends javax.swing.JFrame {

    /** Creates new form FrameUtama */
    public FrameUtama() {
        initComponents();
        setSize(600, 400);
        setLocationRelativeTo(null);
       vis();
          setGlassPane(new PanelLogin());
        getGlassPane().setVisible(false);
        getGlassPane().setVisible(true);
        this.setResizable(false);
        vus();
        
    }

   
    void setStatus(boolean stus){
        buttonTransparan1.setEnabled(stus);
        buttonTransparan3.setEnabled(stus);
        buttonTransparan4.setEnabled(stus);
    }

    void vus(){
        jLabel1.setVisible(true);
         jLabel2.setVisible(true);
         jLabel3.setVisible(true);
         jLabel4.setVisible(true);
          jLabel5.setVisible(true);
          buttonTransparan5.setVisible(true);
    }

void vis(){
     jLabel1.setVisible(false);
         jLabel2.setVisible(false);
         jLabel3.setVisible(false);
         jLabel4.setVisible(false);
          jLabel5.setVisible(false);
          buttonTransparan5.setVisible(false);
}
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panelTransparan1 = new stta.elinfo.perpustakaan.template.PanelTransparan();
        date1 = new stta.elinfo.perpustakaan.template.Date();
        date2 = new stta.elinfo.perpustakaan.template.Date();
        date3 = new stta.elinfo.perpustakaan.template.Date();
        date4 = new stta.elinfo.perpustakaan.template.Date();
        date5 = new stta.elinfo.perpustakaan.template.Date();
        panelBackground1 = new stta.elinfo.perpustakaan.template.PanelBackground();
        panelTransparan2 = new stta.elinfo.perpustakaan.template.PanelTransparan();
        buttonTransparan1 = new stta.elinfo.perpustakaan.template.ButtonTransparan();
        buttonTransparan2 = new stta.elinfo.perpustakaan.template.ButtonTransparan();
        buttonTransparan3 = new stta.elinfo.perpustakaan.template.ButtonTransparan();
        buttonTransparan4 = new stta.elinfo.perpustakaan.template.ButtonTransparan();
        jLabel1 = new javax.swing.JLabel();
        buttonTransparan5 = new stta.elinfo.perpustakaan.template.ButtonTransparan();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();

        javax.swing.GroupLayout panelTransparan1Layout = new javax.swing.GroupLayout(panelTransparan1);
        panelTransparan1.setLayout(panelTransparan1Layout);
        panelTransparan1Layout.setHorizontalGroup(
            panelTransparan1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        panelTransparan1Layout.setVerticalGroup(
            panelTransparan1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        panelBackground1.setLayout(new java.awt.BorderLayout());

        panelTransparan2.setBackground(new java.awt.Color(0, 0, 0));

        buttonTransparan1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/stta/elinfo/perpustakaan/gambar/addd.png"))); // NOI18N
        buttonTransparan1.setToolTipText("Tambah File");
        buttonTransparan1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        buttonTransparan1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonTransparan1ActionPerformed(evt);
            }
        });

        buttonTransparan2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/stta/elinfo/perpustakaan/gambar/orang.png"))); // NOI18N
        buttonTransparan2.setToolTipText("Home");
        buttonTransparan2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        buttonTransparan2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonTransparan2ActionPerformed(evt);
            }
        });

        buttonTransparan3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/stta/elinfo/perpustakaan/gambar/searc.png"))); // NOI18N
        buttonTransparan3.setToolTipText("Cari File");
        buttonTransparan3.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        buttonTransparan3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonTransparan3ActionPerformed(evt);
            }
        });

        buttonTransparan4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/stta/elinfo/perpustakaan/gambar/Exit.png"))); // NOI18N
        buttonTransparan4.setToolTipText("Keluar");
        buttonTransparan4.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        buttonTransparan4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonTransparan4ActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Comic Sans MS", 3, 18));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("SELAMAT DATANG");

        buttonTransparan5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/stta/elinfo/perpustakaan/gambar/transparan.png"))); // NOI18N

        jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 30));
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("PERPUSTAKAAN EBOOK");

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("Builded by :");

        jLabel4.setFont(new java.awt.Font("Lucida Sans", 2, 12));
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("Saiful Bahri");

        jLabel5.setFont(new java.awt.Font("Lucida Sans", 2, 12));
        jLabel5.setForeground(new java.awt.Color(255, 255, 255));
        jLabel5.setText("Prastyo Fendriyanto");

        javax.swing.GroupLayout panelTransparan2Layout = new javax.swing.GroupLayout(panelTransparan2);
        panelTransparan2.setLayout(panelTransparan2Layout);
        panelTransparan2Layout.setHorizontalGroup(
            panelTransparan2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelTransparan2Layout.createSequentialGroup()
                .addGroup(panelTransparan2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelTransparan2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(buttonTransparan2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(buttonTransparan1, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(buttonTransparan3, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(buttonTransparan4, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelTransparan2Layout.createSequentialGroup()
                        .addGap(64, 64, 64)
                        .addComponent(buttonTransparan5, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(27, 27, 27)
                        .addGroup(panelTransparan2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel2)
                            .addGroup(panelTransparan2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel3)
                                .addGroup(panelTransparan2Layout.createSequentialGroup()
                                    .addGap(55, 55, 55)
                                    .addGroup(panelTransparan2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel5)
                                        .addComponent(jLabel4))))))
                    .addGroup(panelTransparan2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel1)))
                .addContainerGap(243, Short.MAX_VALUE))
        );
        panelTransparan2Layout.setVerticalGroup(
            panelTransparan2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelTransparan2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelTransparan2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buttonTransparan2, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonTransparan1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonTransparan3, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonTransparan4, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29)
                .addComponent(jLabel1)
                .addGap(27, 27, 27)
                .addGroup(panelTransparan2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelTransparan2Layout.createSequentialGroup()
                        .addComponent(buttonTransparan5, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(49, Short.MAX_VALUE))
                    .addGroup(panelTransparan2Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 62, Short.MAX_VALUE)
                        .addComponent(jLabel3)
                        .addGap(9, 9, 9)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel5)
                        .addGap(20, 20, 20))))
        );

        panelBackground1.add(panelTransparan2, java.awt.BorderLayout.CENTER);

        getContentPane().add(panelBackground1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonTransparan2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTransparan2ActionPerformed
        // TODO add your handling code here:
        vus();
     setGlassPane(new PanelTambah());
        getGlassPane().setVisible(false);

        setGlassPane(new Cari());
        getGlassPane().setVisible(false);

    }//GEN-LAST:event_buttonTransparan2ActionPerformed

    private void buttonTransparan3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTransparan3ActionPerformed
        // TODO add your handling code here:
        vis();

        setGlassPane(new Cari());
        getGlassPane().setVisible(false);
        getGlassPane().setVisible(true);


    }//GEN-LAST:event_buttonTransparan3ActionPerformed

    private void buttonTransparan4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTransparan4ActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(this, "Apakah anda yakin untuk logout", "konfirmasi", JOptionPane.YES_NO_OPTION)==0){
        vis();
         setGlassPane(new PanelLogin());
        getGlassPane().setVisible(false);
        getGlassPane().setVisible(true);
        vus();}
    }//GEN-LAST:event_buttonTransparan4ActionPerformed

    private void buttonTransparan1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTransparan1ActionPerformed
        // TODO add your handling code here:
       vis();
         setGlassPane(new PanelTambah());
        getGlassPane().setVisible(false);
        getGlassPane().setVisible(true);
    }//GEN-LAST:event_buttonTransparan1ActionPerformed

    /**
    * @param args the command line arguments
    */



    // Variables declaration - do not modify//GEN-BEGIN:variables
    private stta.elinfo.perpustakaan.template.ButtonTransparan buttonTransparan1;
    private stta.elinfo.perpustakaan.template.ButtonTransparan buttonTransparan2;
    private stta.elinfo.perpustakaan.template.ButtonTransparan buttonTransparan3;
    private stta.elinfo.perpustakaan.template.ButtonTransparan buttonTransparan4;
    private stta.elinfo.perpustakaan.template.ButtonTransparan buttonTransparan5;
    private stta.elinfo.perpustakaan.template.Date date1;
    private stta.elinfo.perpustakaan.template.Date date2;
    private stta.elinfo.perpustakaan.template.Date date3;
    private stta.elinfo.perpustakaan.template.Date date4;
    private stta.elinfo.perpustakaan.template.Date date5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private stta.elinfo.perpustakaan.template.PanelBackground panelBackground1;
    private stta.elinfo.perpustakaan.template.PanelTransparan panelTransparan1;
    private stta.elinfo.perpustakaan.template.PanelTransparan panelTransparan2;
    // End of variables declaration//GEN-END:variables

}
